package is.progetto2.activity;

import is.progetto2.activity.abstraction.AbstractBindFactory;

public class BindFactoryImpl extends AbstractBindFactory {

	@Override
	public Bind createBind(BindType b1, Job j1, BindType b2, BindType b3, Job j2) {
		Bind res=new Bind();
		res.setBind1(b1);
		res.setBind2(b2);
		res.setBind3(b3);
		res.setJob1(j1);
		res.setJob2(j2);
		j1.ref.add(res);
		return res;
	}
	
	protected static BindFactoryImpl getDefaultInstance(){
		return new BindFactoryImpl();
	}
	
	private BindFactoryImpl(){
		
	}

	@Override
	public void deleteBindRef(Bind b) {
		Job j1=b.getJob1();
		j1.ref.remove(b);
	}

}
